package model;

import java.io.Serializable;
import java.math.BigDecimal;

public class FootBallMember implements Serializable{

	private static final long serialVersionUID = 1l;

	//年龄 35以上退役，16以上进入职业
	private int age;
	//惯用脚
	private MostFooterEnum mostFooterEnum;

	//场上位置
	private Position position;

	//年薪 满足线性变化，暂定基数为10000 增长步调为1.1
	private BigDecimal salary;

	//所属的球队
	private String club;

	//球员的姓名
	private String name;

	//球员的身高  185以上适合做门将
	private String height;

	//能力值 90-100参加国家队 90以下无机会
	private int abilityValue;

	//是否是国家队
	private boolean isNation;

	//是否可以参加国家队
	private boolean canNationTitle;



	//构造是否可以参国家队
	public void  setCanTitile(){
		if (this.abilityValue > 90){
			this.canNationTitle = true;
		}
		else {
			this.canNationTitle = false;
		}

	}

	public FootBallMember(int age, MostFooterEnum mostFooterEnum, Position position, BigDecimal salary, String club, String name, String height, int abilityValue,boolean isNation) {
		this.age = age;
		this.mostFooterEnum = mostFooterEnum;
		this.position = position;
		this.salary = salary;
		this.club = club;
		this.name = name;
		this.height = height;
		this.abilityValue = abilityValue;
		this.isNation=isNation;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public MostFooterEnum getMostFooterEnum() {
		return mostFooterEnum;
	}

	public void setMostFooterEnum(MostFooterEnum mostFooterEnum) {
		this.mostFooterEnum = mostFooterEnum;
	}

	public Position getPosition() {
		return position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}

	public BigDecimal getSalary() {
		return salary;
	}

	public void setSalary(BigDecimal salary) {
		this.salary = salary;
	}

	public String getClub() {
		return club;
	}

	public void setClub(String club) {
		this.club = club;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public int getAbilityValue() {
		return abilityValue;
	}

	public void setAbilityValue(int abilityValue) {
		this.abilityValue = abilityValue;
	}

	public boolean isCanNationTitle() {
		return canNationTitle;
	}

	public void setCanNationTitle(boolean canNationTitle) {
		this.canNationTitle = canNationTitle;
	}

	public boolean isNation() {
		return isNation;
	}

	public void setNation(boolean isNation) {
		this.isNation = isNation;
	}

	@Override
	public String toString() {
		return "FootBallMember{" +
				"age=" + age +
				", mostFooterEnum=" + mostFooterEnum +
				", position=" + position +
				", salary=" + salary +
				", club='" + club + '\'' +
				", name='" + name + '\'' +
				", height='" + height + '\'' +
				", abilityValue=" + abilityValue +
				", canNationTitle=" + canNationTitle +
				'}';
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		FootBallMember that = (FootBallMember) o;

		if (name != null ? !name.equals(that.name) : that.name != null) return false;

		return true;
	}

	@Override
	public int hashCode() {
		return name != null ? name.hashCode() : 0;
	}
}
